﻿<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="Estados.aspx.vb" Inherits="Hosteria_VS_Estados" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div>
        <br />
        <span class="style1"><strong>Mantenimiento de Estados de Habitaciones</strong></span><br />
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
            AutoGenerateColumns="False" AutoGenerateDeleteButton="True" 
            AutoGenerateEditButton="True" DataKeyNames="Id" DataSourceID="sdaEstados">
            <Columns>
                <asp:BoundField DataField="Id" HeaderText="Id" ReadOnly="True" 
                    SortExpression="Id" />
                <asp:BoundField DataField="Descripcion" HeaderText="Descripcion" 
                    SortExpression="Descripcion" />
            </Columns>
        </asp:GridView>
        <asp:Table ID="Table1" runat="server" Width="85px">
            <asp:TableRow runat="server">
                <asp:TableCell runat="server">
                    <asp:LinkButton ID="btnAgregar" runat="server">Agregar</asp:LinkButton></asp:TableCell>
                <asp:TableCell runat="server"><asp:TextBox ID="txtId" runat="server"></asp:TextBox></asp:TableCell>
                <asp:TableCell runat="server"><asp:TextBox ID="txtDescripcion" runat="server"></asp:TextBox></asp:TableCell>
            </asp:TableRow>
        </asp:Table>
        <asp:SqlDataSource ID="sdaEstados" runat="server" 
            ConnectionString="<%$ ConnectionStrings:TESTConnectionString %>" 
            DeleteCommand="DELETE FROM [Estado] WHERE [Id] = @Id" 
            InsertCommand="INSERT INTO [Estado] ([Id], [Descripcion]) VALUES (@Id, @Descripcion)" 
            SelectCommand="SELECT * FROM [Estado]" 
            UpdateCommand="UPDATE [Estado] SET [Descripcion] = @Descripcion WHERE [Id] = @Id">
            <DeleteParameters>
                <asp:Parameter Name="Id" Type="Int16" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="Id" Type="Int16" />
                <asp:Parameter Name="Descripcion" Type="String" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="Descripcion" Type="String" />
                <asp:Parameter Name="Id" Type="Int16" />
            </UpdateParameters>
        </asp:SqlDataSource>
    </div>
</asp:Content>
